#include <process.h>

namespace Model{

  bool Process::Run()
  {
    subProcessID = fork();
    if(0 == subProcessID){
      ProcessFunction();
      exit(0);
    }
    else if(0 < subProcessID)
      return true;
    else
      return false;
  }

  bool Process::Stop()
  {
    if(0 < subProcessID){
      kill(subProcessID, SIGKILL);
      subProcessID = -1;
      return true;
    }else
      return false;
  }

}
